package com.sicheng.metadata.juc.jmm;

import java.util.concurrent.TimeUnit;

/**
 * @author : zsc
 * @date :
 */
@SuppressWarnings("all")
public class Atomic {

    private static int num;

    public static void main(String[] args) {

        new Thread(() -> {
            while (num == 0) {

            }
        }).start();

        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        num++;
        System.out.println(num);
    }
}
